<?php
	extract($_POST);
  	require('db.php');
  	$sql = "SELECT pass, id FROM dextrob_user WHERE login='".$login."'";
  	$req = mysql_query($sql) or die($alerte = "-1");//or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
	$data = mysql_fetch_assoc($req);
	if($iscrypt == "1"){
		if($data['pass'] != $pass) {
	    	$alerte = "-2";//mauvais login
	  	}else{
	    	$alerte = $pass.' '.$data['id'];//connection
	  	}
	}else{
		if($data['pass'] != md5($pass)) {
	    	$alerte = "0";//mauvais login
	  	}else{
	    	$alerte = md5($pass).' '.$data['id'];//connection
	  	}
	}
	echo $alerte;
?>